from pynput import mouse
import keyboard

def on_click(x, y, button, pressed):
    if pressed:
        print(f'坐标: ({x}, {y})')

# 开始监听鼠标点击
listener = mouse.Listener(on_click=on_click)
listener.start()

print("按下 Ctrl+C 退出程序。")
# 等待 Ctrl+C 组合键被按下
keyboard.wait('ctrl+c')
listener.stop()
